import http from '@/utils/fetch'

export function login(params) {
  return http.post('/Admin/Login', params)
}

export function logout() {
  return http.get('/Admin/LoginOut')
}

// 获取用户菜单权限
export function getAuthRule() {
  return http.post('/Admin/Auth/getAuthRule')
}

// 获取验证码
export function sendMobileCode(mobile) {
  return http.post('/Admin/Verify/sendCode', { mobile }, true)
}

// 编辑密码
export function editPwd(params) {
  return http.post('/Admin/Auth/editPwd', params)
}

// 忘记密码
export function forgetPwd(params) {
  return http.post('/Admin/Login/forgetPwd', params)
}

// alipayinit
export function alipayInit() {
  return http.post('/Admin/Twc/alipayInit', {
    aliKey: 'server_alipay_init_20220411'
  })
}

// alipayinit
export function esignInit() {
  return http.get('/Admin/esign/createByUploadUrl')
}

// alipayinit
export function esignInitSdk() {
  return http.get('/Admin/esign/sdkInit')
}
